package com.example.customer.dto;

import java.util.List;

//��ҳ���йص���Ϣ
public class PageBean {

	private int currentPage=1;//��ǰҳ��
	private int pageSize=5;//ҳ���С
	private int pageCount;//��ҳ��
	private int total;//������
	private List data;//��ǰҳ������
	private String credentials_number;
	private String name;


	public String getCredentials_number() {
		return credentials_number;
	}

	public void setCredentials_number(String credentials_number) {
		this.credentials_number = credentials_number;
	}

	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	
	public PageBean() {}
	public PageBean(int pageIndex, int pageSize, int total, String name,String credentials_number){
		this.pageSize=pageSize;
		this.total=total;
		this.name=name;
		//�����ҳ��
		 if(total%pageSize==0){// 13  3
			 this.pageCount=total/this.pageSize;
		 }
		 else{
			 this.pageCount=total/this.pageSize+1;
		 }
		 this.currentPage=pageIndex;//4   1
		 if(pageIndex>this.pageCount) this.currentPage=this.pageCount;
		 if(pageIndex<1) this.currentPage=1;
	}
	
	
	//��ʼ�±�    between  ? and ?
	public int getStartIndex(){
		return (this.currentPage-1)*this.pageSize+1;
	}
	//�����±�
	public int getEndIndex(){
		return this.currentPage*pageSize;
	}
	

	public int getPageSize() {
		return pageSize;
	}
	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}
	public int getPageCount() {
		return pageCount;
	}
	public void setPageCount(int pageCount) {
		this.pageCount = pageCount;
	}
	
	public int getCurrentPage() {
		return currentPage;
	}


	public void setCurrentPage(int currentPage) {
		this.currentPage = currentPage;
	}


	public int getTotal() {
		return total;
	}


	public void setTotal(int total) {
		this.total = total;
	}


	public List getData() {
		return data;
	}
	public void setData(List data) {
		this.data = data;
	}
	
}
